package com.crimsec.utils.snmp.web.rest;

import com.crimsec.utils.snmp.model.Mibent;
import com.crimsec.utils.snmp.service.MibentService;
import javax.ejb.EJB;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import static javax.ws.rs.core.MediaType.*;
import org.apache.log4j.Logger;

/**
 * @author moroz
 */
@Path("mibent")
public class MibentResource {

    private static Logger log = Logger.getLogger("jsnmp.web.mibent");
    //
    @EJB
    MibentService entService;

    @GET
    @Path("{id}")
    @Produces(APPLICATION_XML)
    public Mibent get(@PathParam("id") short id) {
          
    
        log.debug("get-mibent-request, with param:" + id);
        return entService.get(id);
        

    }

    @GET
    @Path("count")
    @Produces(APPLICATION_XML)
    public String getMibentCount() {
        log.debug("get-mibent-count-request");
        return "<mibent-count>" + entService.getCount() + "</mibent-count>";
    }
}
